package com.example.rabbitmq.receiver;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Copyright(C), 2020-2021, AmbroseCdMeng
 * FileName:    ReceiverA
 * Author:      AmbroseCdMeng
 * Date:        2021/2/27 15:08
 * Description: 接收者 A
 *              ★ 注意发送者和接收者的 Queue 名称必须一致，否则不能接收 ★
 * History:
 * <author>     <time>      <version>       <desc>
 * 作者姓名     修改时间        版本号           描述
 */
@Component
// 监听 QueueHello 的消息队列
@RabbitListener(queues = "Queue1")
public class ReceiverA {
    // @RabbitHandler 来实现具体消费
    @RabbitHandler
    public void QueueReceiver(String Queue1){
        System.out.println("Receiver A: " + Queue1);
    }
}
